package edu.lab3;

import edu.lab3.filter.VueFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.ResourceUtils;

import java.io.File;
import java.io.FileNotFoundException;

@SpringBootApplication
public class Lab3Application {

    public static void main(String[] args) throws FileNotFoundException {
        SpringApplication.run(Lab3Application.class, args);
    }

    @Bean
    public FilterRegistrationBean filterRegistration() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        // 注册vue过滤器
        registration.setFilter(new VueFilter());
        registration.addUrlPatterns("/vue/*");
        registration.setName("vueFilter");
        return registration;
    }

}
